package com.iss.view;

import com.iss.view.order.CheckOut;
import com.iss.view.Customer.CustomerWindow;
import com.iss.view.room.AddWindow;
import com.iss.view.room.ListWindow;
import com.iss.view.view.Window;

import java.util.Scanner;

public class Index extends Window {
    @Override
    public String print() {
        String cmd;
        Scanner scanner = new Scanner(System.in);
        System.out.println("1.房间列表(L)");
        System.out.println("2.添加房间(A)");
        System.out.println("3.入住登记(I)");
        System.out.println("4.离店确认(O)");
        System.out.print("请输入你的命令：");
        cmd = scanner.next();
        return cmd;
    }
    @Override
    public Window getNextWindow(String cmd) {
        if (cmd.equals("L")){
           return  new ListWindow();
        }
        if (cmd.equals("A")){
            return new AddWindow();
        }
        /**
         * 在进行订单录入前
         * 先录入客人信息
         * **/
        if (cmd.equals("I")){
            return new CustomerWindow();
        }

        if (cmd.equals("O")){
            return new CheckOut();
        }
        return null;
    }
}
